#ifndef FACTORY_H_
#define FACTORY_H_

#include "musicTool.h"

class MusicToolPhototypeFactory
{
public:
	MusicToolPhototypeFactory(Piano* pPiano, Flute* pFlute)
	{
		m_pPiano = pPiano;
		m_pFlute = pFlute;
	}

	~MusicToolPhototypeFactory()
	{
		if (!m_pPiano)
		{
			delete m_pPiano, m_pPiano = NULL;
		}

		if (!m_pFlute)
		{
			delete m_pFlute, m_pFlute = NULL;
		}
	}

public:
	virtual Piano* MakePiano()
	{
		return m_pPiano->clone();
	}

	virtual Flute* MakeFlute()
	{
		return m_pFlute->clone();
	}

private:
	Piano* m_pPiano;
	Flute* m_pFlute;
};

#endif // FACTORY_H_
